package com.ityj.yygh.user.controller.api;

import com.ityj.yygh.result.Result;
import com.ityj.yygh.user.service.UserInfoService;
import com.ityj.yygh.vo.user.LoginVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(value = "用户系统模块")
@RestController
@RequestMapping(path = "/api/user")
@Slf4j
public class UserInfoApiController {

    @Autowired
    private UserInfoService userInfoService;

    @ApiOperation("用户手机号登录接口")
    @PostMapping(path = "/login")
    public Result<Map<String, Object>> loginWithPhone(@RequestBody LoginVo loginVo) {

        Map<String, Object> result = userInfoService.loginWithPhone(loginVo);
        return Result.ok(result);
    }
}
